package com.feicheng.lanniao.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.feicheng.lanniao.entity.SysRegion;
import com.feicheng.lanniao.mapper.SysRegionMapper;
import com.feicheng.lanniao.result.ResultInfo;
import com.feicheng.lanniao.service.ISysRegionService;

/**
 * <p>
 * 行政区字典表 服务实现类
 * </p>
 *
 * @author feichengTech
 * @since 2021-09-02
 */
@Service
public class SysRegionServiceImpl extends ServiceImpl<SysRegionMapper, SysRegion> implements ISysRegionService {

	//查询一条记录
	@Override
	public ResultInfo getSysRegionList(Integer parentId) {
		//接到1个parentId 查一堆SysRegion对象
		QueryWrapper<SysRegion> queryWrapper = new QueryWrapper<SysRegion>();
		queryWrapper.eq("parent_id", parentId);			
		List<SysRegion> list = this.list(queryWrapper);
		return ResultInfo.success(list);
	}

	

}
